home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / refreshAE.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.9 KB  |  105 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //    Creation Date:    June 24, 1997
  22. //    Author:            ajp
  23. //
  24. //
  25. //<doc>
  26. //<name refreshAE>
  27. //<owner "Alias|Wavefront Unsupported">
  28. //
  29. //<synopsis>
  30. //    refreshAE
  31. //
  32. //<returns>
  33. //    None
  34. //
  35. //<description>
  36. //    Refreshes the attribute editor. (Only if it's visible.)
  37. //
  38. //<flags>
  39. //    None
  40. //
  41. //<examples>
  42. //  refreshAE;
  43. //
  44. //</doc>
  45.  
  46. global proc refreshAE()
  47. {
  48.     global string $gAttributeEditorWindowName;
  49.     global string $gAEBaseLayoutName;
  50.     global string $gAETabLayoutName;
  51.     global string $gAEFocusNode;
  52.  
  53.     if (    (    `window -exists $gAttributeEditorWindowName` 
  54.             &&    `window -q -vis $gAttributeEditorWindowName`) 
  55.         ||    (`isAttributeEditorVisible`))
  56.     {
  57.         // update the tabs
  58.         if (`objExists $gAEFocusNode`) {
  59.  
  60.             // find out what tab is currently being viewed
  61.             //
  62.             string    $tabLabels[] = `tabLayout -q -tl $gAETabLayoutName`;
  63.             int        $tabIndex = `tabLayout -q -sti $gAETabLayoutName`;
  64.             string    $currentTab = $tabLabels[$tabIndex-1];
  65.  
  66.             AEbuildAllTabs $gAEFocusNode;
  67.  
  68.             // check if the currentTab still exists
  69.             $tabLabels = `tabLayout -q -tl $gAETabLayoutName`;
  70.             for ($i = 0; $i < size($tabLabels); $i++) {    
  71.                 if ($currentTab == $tabLabels[$i]) {
  72.                     tabLayout -e -st ("formTab"+$i) $gAETabLayoutName;
  73.                     return;
  74.                 }
  75.             }
  76.  
  77.             // if we've gotten this far, currentTab no longer
  78.             // exists, rebuild the AE and select $gAEFocusNode's tab
  79.             //
  80.             updateAE($gAEFocusNode);
  81.  
  82.         } else {
  83.  
  84.             // BUG #172131
  85.             // In certain cases (like a curve on surface) $gAEFocusNode
  86.             // does not exist but $gAEFocusNode stripped of '|' does.
  87.             // Only make the formLayout invisible if neither $gAEFocusNode
  88.             // nor $gAEFocusNode stripped of '|' exist.
  89.             string $stripped = `substitute "|" $gAEFocusNode ""`;
  90.             if ( !`objExists $stripped` )
  91.             {
  92.                 formLayout -e -visible false $gAEBaseLayoutName;
  93.             }
  94.  
  95.             if (`window -exists $gAttributeEditorWindowName`) 
  96.             {
  97.                 window -e
  98.                     -title ("Attribute Editor")
  99.                     $gAttributeEditorWindowName;
  100.             }
  101.  
  102.         }
  103.     }
  104. }
  105.